<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test-javascipt</title>
<script type="text/javascript" src="dom.js"></script>
<script type="text/javascript" src="jscore.js"></script>
<style type="text/css">
.font{ font-size:30px;}
.color{ color:#f00;}
#test{ border:2px solid; text-align:center;}
#animate{ width:100px; height:100px; background-color:#000; position:absolute; left:50px; top:50px;}
#parse{ width:50px; height:50px; background-color:#f00;}
#fly{ background-color:#C0F; width:80px; height:80px;}
</style>
</head>

<body>
<div id="test" class="font color">JavaScript Test</div>
<div id="animate"></div>
<div id="parse"></div>
<div id="fly" style="left:1px;"></div>

<script type="text/javascript">
var test = document.getElementById("test");
var animate  = document.getElementById("animate");
var id_parse = document.getElementById("parse");
var fly  = document.getElementById("fly");

/*测试addClass()函数：
var font = "font";
var style = ["font","color"];
var style = Array("color","font");
addClass(test,style);
*/

/*测试removeClass()函数：
var font = "font";
var style = Array("color","font"); 
var style = ["color","font"];
removeClass(test,style);
*/

/*测试getWidth()函数：
var width  = getWidth(animate);
alert("外部样式，宽："+width);
var height = getHeight(animate);
alert("外部样式，高："+height);
*/

/*测试setOpacity()函数：*/
setOpacity(animate,0.8);

/*测试alignTo()函数：*/
alignTo(id_parse,animate);

/*测试animateFly()函数：*/
animateFly(fly);
/*
function animate1(){
	var ele  = document.getElementById("fly"); 
	ele.style.position = "absolute";
	var left = parseFloat(ele.style.left);
	var top  = parseFloat(ele.style.top);
	if(left == 500 && top == 200) return true;
	if(left < 500)
	{
		left++;	
	}	
	if(left > 500)
	{
		left--;	
	}
	if(top < 200)
	{
		top++;	
	}
	if(top > 200)
	{
		top--;	
	}
	ele.style.left = left+"px";
	ele.style.top  = top+"px";
	move = setTimeout("animate1()",10);
}
window.onload = animate1;
*/



</script>
</body>
</html>